<?php
/**
 * User Class
 *
 */
class GeolocResponse extends MyObject {

	protected $xml;
	
	
	public function __construct($xml) {
		
		parent::__construct();
		
		$this->xml = $xml;
	}
	
	public function isValid() {
		return $this->xml->status->status_code == 200;
	}
	
	public function getStatusCode() {
		return $this->xml->status->status_code;
	}
	
	public function getLatitude() {
		return $this->isValid() ? $this->xml->location->Y : false;
	}
	
	public function getLongitude() {
		return $this->isValid() ? $this->xml->location->X : false;
	}
}
?>
